package Askgene::Database::Schema::TheSchwartz::Job;

use strict;
use warnings;

use base 'DBIx::Class';

__PACKAGE__->load_components("Core");
__PACKAGE__->table("job");
__PACKAGE__->add_columns(
    "jobid",
    {
        data_type         => "BIGINT",
        is_nullable       => 0,
        size              => 20,
        is_auto_increment => 1
    },
    "funcid",
    { data_type => "INT", is_nullable => 0, size => 10 },
    "arg",
    {
        data_type     => "MEDIUMBLOB",
        default_value => undef,
        is_nullable   => 1,
        size          => 16777215,
    },
    "uniqkey",
    {
        data_type     => "VARCHAR",
        default_value => undef,
        is_nullable   => 1,
        size          => 255,
    },
    "insert_time",
    { data_type => "INT", is_nullable => 1, size => 10 },
    "run_after",
    { data_type => "INT", is_nullable => 0, size => 10 },
    "grabbed_until",
    { data_type => "INT", is_nullable => 0, size => 10 },
    "priority",
    {
        data_type   => "SMALLINT",
        is_nullable => 1,
        size        => 5,
    },
    "coalesce",
    {
        data_type   => "VARCHAR",
        is_nullable => 1,
        size        => 255,
    },
);
__PACKAGE__->set_primary_key("jobid");
__PACKAGE__->add_unique_constraint( "funcid_2", [ "funcid", "uniqkey" ] );

__PACKAGE__->has_one( 'function', 'TheSchwartz::Funcmap',
    { 'foreign.funcid' => 'self.funcid' } );

1;
